home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / borllexp / blx_1_1 / winfont.h < prev   
Text File  |  1991-01-21  |  780b  |  20 lines

  1. #include<windows.h>
  2. #include<string.h>
  3. class WinFont {
  4.     LOGFONT lf;
  5.     HFONT hFont;
  6. public:
  7.     WinFont(void) {
  8.         memset(&lf,0,sizeof(LOGFONT));
  9.         hFont = NULL;
  10.     }
  11.     void Create(void)       { hFont = CreateFontIndirect(&lf); }
  12.     HFONT GetHandle(void)   { return hFont; }
  13.     void SetFontWeight(int weight)               {  lf.lfWeight = weight;  }
  14.     void SetFontCharSet(BYTE charset)        {  lf.lfCharSet = charset; }
  15.     void SetFontPitchAndFamily(BYTE pnf)  {  lf.lfPitchAndFamily = pnf; }
  16.     void SetFontHeight(int height)                { lf.lfHeight = height; }
  17.     void SetFontWidth(int width)                   { lf.lfWidth = width; }
  18.     void SetFontName(char *name)              { strcpy((char *)lf.lfFaceName, name); }
  19. };
  20.